package com.design.cjm.behavioral.strategy.example1;

/**
 * context 上下文，维护一个对abstractStrategy的对象的引用
 *
 * @Author: Jie Ming Chen
 * @Date: 2018/9/17
 * @Version 1.0
 */
public class Context {

    private AbstractStrategy abstractStrategy;

    public Context(AbstractStrategy abstractStrategy){
        this.abstractStrategy = abstractStrategy;
    }

    /**
     * 上下文接口，根据具体的策略对象，调用其算法的方法
     */
    public void contextInterface(){
        abstractStrategy.algorithmInterface();
    }

}
